Skip to content

Conversation

@MIchaelRShea
Copy link
Contributor

@MIchaelRShea MIchaelRShea commented Jun 14, 2023

Summary

Allow dynamic platform resolution for projects not mentioned in a solution.

Customer Impact

Enables adoption of dynamic platform resolution for dev-desktop scenarios in a large internal repo.

Regression?

No.

Testing

This was tested in the VS repo on the VC sln which covers lots of scenarios

Risk

Low--feature has low adoption because of sticking points like this, so blast radius of regression is low.

Details

Context

Currently we turn off dynamic platform resolution for a whole solution if a single project in the solution is assigned a configuration. This is problematic as some projects are outside of the scope of the solution but still have certain targets that run on them that are architecture specific. These projects will build as the wrong architecture because no configuration is defined and no platform negotiation takes place.

Changes Made

I removed the conditional that turns platform negotiation off on a sln level. The logic to turn this off on a project level is already in place through checking is a projectreference has setplatform appended to it. This will make sure no projects with configurations defined will be negotiated for as MSbuild ads setplatform metadata to projectreferences with configurations.

@AR-May AR-May requested review from JanKrivanek, MichalPavlik and rainersigwald and removed request for MichalPavlik June 20, 2023 13:55
@rainersigwald
Copy link
Member

Can you please add a test covering this?

@rainersigwald
Copy link
Member

Also, what's the impact on graph + platform negotiation?

@rainersigwald rainersigwald added this to the VS 17.7 milestone Jun 22, 2023
@MIchaelRShea
Copy link
Contributor Author

Can you please add a test covering this?

By this do you mean automation? or a description of the testing we went through in order to validate this change

@rainersigwald
Copy link
Member

I'd prefer an automated test in this repo, yeah. If there aren't any end-to-end tests for this feature area maybe only the graph stuff gets tested.

Copy link

@donJoseLuis donJoseLuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comment

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed a few nits and have a few more comments here.

@MIchaelRShea MIchaelRShea force-pushed the dev/michaelshea/sln branch from 3c96ea7 to 6e2ac16 Compare July 6, 2023 15:06
Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
Thank you!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: Sln or even better SolutionFile

Currently we turn off dynamic platform resolution for a whole solution
if a single project in the solution is assigned a configuration. This is
problematic as some projects are outside of the scope of the solution
but still have certain targets that run on them that are architecture
specific. These projects will build as the wrong architecture because no
configuration is defined and no platform negotiation takes place.

I removed the conditional that turns platform negotiation off on a sln
level. The logic to turn this off on a project level is already in place
through checking is a projectreference has setplatform appended to it.
This will make sure no projects with configurations defined will be
negotiated for as MSbuild adds setplatform metadata to projectreferences
with configurations.
@rainersigwald rainersigwald changed the base branch from main to vs17.7 July 12, 2023 18:55
@rainersigwald rainersigwald mentioned this pull request Jul 12, 2023
@rainersigwald rainersigwald merged commit 971bf70 into dotnet:vs17.7 Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants